﻿using System;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;

namespace BlobStroage
{
    public class PerformanceDataContext : TableServiceContext
    {
        public PerformanceDataContext(string baseAddress, StorageCredentials credentials)
            : base(baseAddress, credentials)
        {
            ResolveType = ResolveEntityType;
        }

        public Type ResolveEntityType(string name)
        {
            var type = typeof(PerformanceData);
            return type;
        }

        public IQueryable<PerformanceData> PerfData
        {
            get { return this.CreateQuery<PerformanceData>("WADPerformanceCountersTable"); }
        }
    }
}
